// AUTO GENERATED CODE!
// CODE GENERATOR WILL NOT PRESERVE MANUAL CHANGES TO THIS CODE!
// 

// MIT License (MIT)
// 
// Copyright (c) 2014 K Ercan Turkarslan
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 


using System;
// ReSharper disable once RedundantUsingDirective 
using Mios.Generated.ServiceFiles;

namespace Mios.Generated.DeviceFiles
{
    // Generated from D_ZWaveNetwork.xml
    
    public class ZWaveNetwork : MiosDevice
    {
        // This device only implements following Actions and State Variables from
        // referenced Service Descriptions.
        // 
        // Following information was gathered from USER_DATA and LU_ACTIONS calls
        // for existing devices from Vera Engine specified during code generation.
        
        // S. Var urn:micasaverde-com:serviceId:HaDevice1 AutoConfigure 
        // S. Var urn:micasaverde-com:serviceId:HaDevice1 LastTimeOffset 
        // S. Var urn:micasaverde-com:serviceId:HaDevice1 LastUpdate 
        // Action urn:micasaverde-com:serviceId:HaDevice1 Poll() 
        // Action urn:micasaverde-com:serviceId:HaDevice1 Reconfigure() 
        // Action urn:micasaverde-com:serviceId:HaDevice1 Remove() 
        // Action urn:micasaverde-com:serviceId:HaDevice1 SetPollFrequency(boolean PollingEnabled, ui1 PollMinDelay) 
        // Action urn:micasaverde-com:serviceId:HaDevice1 StressTest() 
        // Action urn:micasaverde-com:serviceId:HaDevice1 ToggleState() 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 AddNodes(string InclusionMode, string NodeType, ui1 Timeout, boolean Multiple, boolean ControllerShift, boolean Reload) 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 BackupDongle(boolean Restore) 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 ComPort 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 DownloadNetwork() 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 HealNetwork(ui1 BatteryMinutes, ui1 Node, ui1 StressCycles, boolean Configure, boolean ManualRoute, ui1 StartStage, ui1 StopStage) 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 HomeID 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 LastDongleBackup 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 LastError 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 LastHeal 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 LastRouteFailure 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 LastUpdate 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 LimitNeighbors 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 LockComPort 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 NetStatusID 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 NetStatusText 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 PollAllNodes() 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 PollDelayDeadTime 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 PollDelayInitial 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 PollFrequency 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 PollingEnabled 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 PollMinDelay 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 PutByte(string StartAddress, string StopAddress, string Value) 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 ReconfigureAllNodes(boolean FailedOnly) 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 RemoveNodes(string InclusionMode, string NodeType, ui1 Timeout, boolean Multiple, boolean Reload) 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 ResetNetwork(string ResetMode, string HomeID, boolean ZeroMemory) 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 Role 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 SceneIDs 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 SendData(ui1 Node, string Data) 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 SetPolling(boolean IsTemporary, boolean PollingEnabled, ui1 PollDelayInitial, ui1 PollDelayDeadTime, ui1 PollMinDelay, ui1 PollFrequency) 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 SimulateIncomingData(string Data) 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 TO3066 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 UpdateNeighbors(ui4 Device) 
        // Action urn:micasaverde-com:serviceId:ZWaveNetwork1 UpdateNetwork() 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 Use45 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 UseMR 
        // S. Var urn:micasaverde-com:serviceId:ZWaveNetwork1 VersionInfo 
        
        #region Inherited ServiceNodes
        
        // WARNING: This service definition was not found in the device file.
        // However an action or state variable from this Service was returned by
        // USER_DATA xml.
        
        public HaDevice1Service SHaDevice1 { get; private set; }
        
        public ZWaveNetwork1Service SZWaveNetwork1 { get; private set; }
        
        #region Method InitializeInheritedServices(MiosEngine engine, UInt32 deviceId)
        private void InitializeInheritedServices(MiosEngine engine, UInt32 deviceId)
        {
            SHaDevice1 = new HaDevice1Service(engine, deviceId, "urn:micasaverde-com:serviceId:HaDevice1");
            SZWaveNetwork1 = new ZWaveNetwork1Service(engine, deviceId, "urn:micasaverde-com:serviceId:ZWaveNetwork1");
        }
        #endregion Method InitializeInheritedServices
        
        #endregion Inherited ServiceNodes
        
        #region Method SetVariable(String serviceId, String variable, String value) : Boolean;
        internal override Boolean SetVariable(String serviceId, String variable, String value)
        {
            switch(serviceId)
            {
                case "urn:micasaverde-com:serviceId:HaDevice1":
                    return SHaDevice1.SetVariable(variable, value);
                case "urn:micasaverde-com:serviceId:ZWaveNetwork1":
                    return SZWaveNetwork1.SetVariable(variable, value);
                case "urn:micasaverde-com:serviceId:ZWaveDevice1":
                    return SZWaveDevice1.SetVariable(variable, value);
                
                default:
                    return false;
            }
        }
        #endregion Method SetVariable
        
        #region Method SetShortCode(String shortCode, String value) : Boolean;
        internal override Boolean SetShortCode(String shortCode, String value)
        {
            switch(shortCode)
            {
                case "batterylevel":
                    return SetVariable("urn:micasaverde-com:serviceId:HaDevice1", "BatteryLevel", value);
                default:
                    return false;
            }
        }
        #endregion Method SetShortCode
        
        #region Constructor(s)
        public ZWaveNetwork(MiosEngine engine, UInt32 deviceId)
            : base(engine, deviceId)
        {
            InitializeInheritedServices(engine, deviceId);
        } //End Constructor
        
        #if USE_SDATA || USE_USERDATA
        public ZWaveNetwork(MiosEngine engine, UInt32 deviceId, String name, String localUdn, String deviceType, MiosRoom room)
            : base(engine, deviceId, name, localUdn, deviceType, room)
        {
            InitializeInheritedServices(engine, deviceId);
        } //End Constructor
        #endif
        #endregion Constructor(s)
        
    } //End of class
} //End of Namespace

